<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap{

/*	
protected function _initFrontController()
{
	
	$front = Zend_Controller_Front::getInstance();       
    
	 $front->setControllerDirectory(array(
      'home' => APPLICATION_PATH.'/modules/home/controllers',
      'front' =>    APPLICATION_PATH.'/modules/front/controllers',
	  'profile' =>    APPLICATION_PATH.'/modules/profile/controllers',
	  'registration' =>    APPLICATION_PATH.'/modules/registration/controllers'   
            ));	

	$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/routers.ini',  'sanpham');
	$router = new Zend_Controller_Router_Rewrite();
	$router = $router->addConfig($config,  "routes");
	$front->setRouter($router);
	return $front;
	
}
*/

   protected function _initAutoload(){
		$arrBook = array('PHP','ASP','JSP');
		Zend_Registry::set('abc',$arrBook);
	}
	
	

   
	protected function _initDb(){
		
		$bootstrap = $this->getOptions();
		
		$option = $bootstrap['resources']['db'];
		
		$adapter = $option['adapter'];
		$config =  $option['params'];
		
		
		
		$db = Zend_Db::factory($adapter,$config);
		
		$db->setFetchMode(Zend_Db::FETCH_ASSOC);
        $db->query("SET NAMES 'utf8'");
        $db->query("SET CHARACTER SET 'utf8'");       
       
        Zend_Registry::set('connectDB',$db);
		
        //Khi thiet lap che do nay model moi co the su dung duoc
       Zend_Db_Table::setDefaultAdapter($db);
        
        // Return it, so that it can be stored by the bootstrap
       
        return $db;
        
	}
}